<div style="padding-right: 22px;padding-left: 20px;text-align: left;padding-bottom: 20px">
<table style="width:100%;padding-right: 2px;" class="_form">
    <tbody>
    <tr>
        <td style="width: 400px">
            <div class="_input-label">
                <div class="input">
                    <input type="text" id="txt_new_title" placeholder="" 
                           {{if $configs["obj"]["lock"]==1}}disabled=1{{/if}}
                           value="{{$configs["obj"]["title"]}}">
                    <div class="label"><label>Tiêu đề</label></div>
                </div>
            </div>
        </td>
        <td class="space"></td>
        <td style="position: relative">
            <div class="_input-label" type="select">
                <div class="input" type="select">
                    <div class="select">
                        <select id="cbx_new_category">
                            <option {{if $configs["obj"]["category"]=="Trợ Giúp"}}selected=1{{/if}} value="Trợ Giúp">Trợ Giúp</option>
                            <option {{if $configs["obj"]["category"]=="Về Chúng Tôi"}}selected=1{{/if}} value="Về Chúng Tôi">Về Chúng Tôi</option>
                            <option {{if $configs["obj"]["category"]=="Hợp Tác"}}selected=1{{/if}} value="Hợp Tác">Hợp Tác</option>
                            
                            <option {{if $configs["obj"]["category"]=="Khác"}}selected=1{{/if}} value="Khác">Khác</option>

                        </select>
                    </div>
                    <div class="label"><label>Danh mục</label></div>
                </div>
            </div>
        </td>
        
        
    </tr>
    <tr>
        <td style="" colspan="3">
            <div class="_input-label">
                <div class="input">
                    <div id="txt_new_alias" style="position: absolute;
top: 0;
left: 0;
right: 0;
padding: 0;
margin: 0;
padding-left: 108px;
width: 100%;
border: 1px solid #CCC;
height: 26px;
line-height: 26px;
background: #FAFAFA;
behavior: url(../lib/PIE/PIE.htc);">{{$configs["obj"]["alias"]}}</div>
                    
                    <input type="hidden" id="txt_new_id" placeholder="" value="{{$configs["obj"]["id"]}}">
                    <div class="label"><label>Alias</label></div>
                </div>
            </div>
        </td>
        
    </tr>
    
    <tr>
        <td colspan="3">


            <div class="input-full">
                <div class="label" style="width: 916px"><label>Nội dung</label></div>
            </div>
            <div style="padding:27px 0px 0 0;" id="editor_content">
                
                <textarea class="_s _w100 mceEditor" id="txt_new_content" rows="3" cols="103" 
                        style="width: 100%; height: 200px;padding-left: 8px" aria-hidden="true">{{$configs["obj"]["content"]}}</textarea>

            </div>
                
        </td>
    </tr>
    <tr>
        <td colspan="3" style="">
            <span style="color: blue">Thêm lúc : </span>
        </td>
    </tr>
</tbody>
</table>
<input type="button" class="classic-button" value="Lưu" onclick="save_new()">
<input type="button" class="classic-button" value="Trở Lại" onclick="News.hideDetailbox();">
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var theme = 'classic';
        AddHandleEventss();
        CreateEditorElement();
    });
    var k;
    function AddHandleEventss(){
        $("#txt_new_title").keypress(function(event) {
            try{
                clearTimeout(k);
            }catch(e){
            }
            k=setTimeout(function(){
                var str=$("#txt_new_title").val();
                
                var url=base_url+"admin-planners/news/alias";
                var data={ str : str.toLowerCase() };
                htmlAjax(url,data,"#txt_new_alias");
                
            }, 2000);
        });
    }
    function CreateEditorElement(){
         tinyMCE.init({
                // General options
                mode : "textareas",
                editor_selector : "mceEditor",
                editor_deselector : "mceNoEditor",
                theme : "advanced",
                plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
                width : "918",
                height:"500",
                // Theme options
                theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
                theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
                theme_advanced_toolbar_location : "top",
                theme_advanced_toolbar_align : "left",
                theme_advanced_statusbar_location : "bottom",
                theme_advanced_resizing : true,

                // Skin options

                // Example content CSS (should be your site CSS)
                content_css : base_url+"deal_css/css/tinymce.css",
                // Drop lists for link/image/media/template dialogs
                template_external_list_url : "js/template_list.js",
                external_link_list_url : "js/link_list.js",
                external_image_list_url : "js/image_list.js",
                media_external_list_url : "js/media_list.js"

        });
    }
</script>
